{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#用截断奇异值分解降维"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "截断奇异值分解（Truncated singular value decomposition，TSVD）是一种矩阵因式分解（factorization）技术，将矩阵$M$分解成$U$，$\\Sigma$和$V$。它与PCA很像，只是SVD分解是在数据矩阵上进行，而PCA是在数据的协方差矩阵上进行。通常，SVD用于发现矩阵的主成份。\n",
    "\n",
    "<!-- TEASER_END -->"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##Getting ready"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "TSVD与一般SVD不同的是它可以产生一个指定维度的分解矩阵。例如，有一个$n \\times n$矩阵，通过SVD分解后仍然是一个$n \\times n$矩阵，而TSVD可以生成指定维度的矩阵。这样就可以实现降维了。\n",
    "\n",
    "这里我们还用`iris`数据集来演示TSVD："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from sklearn.datasets import load_iris\n",
    "iris = load_iris()\n",
    "iris_data = iris.data"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##How to do it..."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "TSVD对象的用法和其他对象类似。首先导入需要的类，初始化，然后拟合："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "from sklearn.decomposition import TruncatedSVD"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 5.1,  3.5,  1.4,  0.2],\n",
       "       [ 4.9,  3. ,  1.4,  0.2],\n",
       "       [ 4.7,  3.2,  1.3,  0.2],\n",
       "       [ 4.6,  3.1,  1.5,  0.2],\n",
       "       [ 5. ,  3.6,  1.4,  0.2]])"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "svd = TruncatedSVD(2)\n",
    "iris_transformed = svd.fit_transform(iris_data)\n",
    "iris_data[:5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 5.91220352, -2.30344211],\n",
       "       [ 5.57207573, -1.97383104],\n",
       "       [ 5.4464847 , -2.09653267],\n",
       "       [ 5.43601924, -1.87168085],\n",
       "       [ 5.87506555, -2.32934799]])"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "iris_transformed[:5]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "最终结果如下图所示："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.text.Text at 0x8600be0>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAATsAAAFCCAYAAACO8XrOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3XecVNXZwPHfM3Onb6FJlaYIItKVagELKrbYS4wl9qjR\naGIsr4kxMTFv7PW1d8XeFbGAiAJSVFB6lya9bJv6vH/cuzpudpdddmGBeb6fz3x2Z+455547s/Ps\nueece66oKsYYs6vzNXQFjDFme7BgZ4zJCRbsjDE5wYKdMSYnWLAzxuQEC3bGmJxgwc4gIk+JyN8b\nuh7GbEsW7LZARIpEZLP3yIhISdbzMxq6fgBevfaoQxHqPSorOygid4jID94xLxSRu7xtI0Xkb5Xk\nOV5EVoiI3wukcRHZ5D2mi8g/RaSgppUTkdtFZI6Xf6aI/GYL6QtE5G4RWezVeZ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/ituy+KKZx1wGVR07Ee+Djd/BFVwWnu3hh93QicFmcwfdTngGe6OqFiyc7MrgH2ufvL9I1a\n3cSoyTYVmGFml8UQQwa4CLjf3S8Cmqhek6RTZpYFPgH8JMYYPkCovZwN/D7Q38xuiCMWd98A/BOh\nifRz4GX6xoc1AB5GFOPuEupTzOxOoN3du/zArmTN7qPAtGgO3mPAJDP7cQXL65K774n+3U/om4qj\n324nYYndiuj7JwnJL05TgZXR6xKXK4Et7v6WuxeAuYT/f2Lh7nPcfby7fwz4LfBaXLFEGs3sdAAz\n+yCwr5vzE8PMbiJ0lXX74VixZOfuX3P3D7n7MEIzaYm7f6ZS5XXFzOrNbED0dT/CMre1XT+r/Nx9\nL7DDzIZHh64E1lc7jqP8BeHDKE7bgEvNrM7MjPC6vBJXMGZ2avTvmYTO+Nia+JF5wI3R1zcCT8UY\nS0dx94FfRegmu9bdW7t9grtX/AF8DJhXjbKOUf4wYHX0WAfcEWMsFwArgF8TajADY4ylH/AmMCCu\nGDrE8k3CyPRaQid8TYyxLCV8CK0GLq9y2Y8R+i3bgR3AZ4HBwCLCiOPzwKCYYvkcYXBkB9AC7AV+\nHmMsmwgflC9Hj/u7uoYmFYtIImhbdhFJBCU7EUkEJTsRSQQlOxFJBCU7EUkEJTsRSQQlOxFJBCU7\nEUmE/wcl3iR19adhtgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x84cd240>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%matplotlib inline\n",
    "import matplotlib.pyplot as plt\n",
    "f = plt.figure(figsize=(5, 5))\n",
    "ax = f.add_subplot(111)\n",
    "\n",
    "ax.scatter(iris_transformed[:, 0], iris_transformed[:, 1], c=iris.target)\n",
    "ax.set_title(\"Truncated SVD, 2 Components\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##How it works..."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "现在我们演示了scikit-learn的`TruncatedSVD`模块，让我们看看只用`scipy`学习一些细节。\n",
    "\n",
    "首先，我们用`scipy`的`linalg`处理SVD："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1, 2],\n",
       "       [1, 3],\n",
       "       [1, 4]])"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import numpy as np\n",
    "from scipy.linalg import svd\n",
    "D = np.array([[1, 2], [1, 3], [1, 4]])\n",
    "D"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "((3, 2), (2,), (2, 2))"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "U, S, V = svd(D, full_matrices=False)\n",
    "U.shape, S.shape, V.shape"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "我们可以根据SVD的定义，用$U$，$S$和$V$还原矩阵$D$："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 5.64015854,  0.        ],\n",
       "       [ 0.        ,  0.43429448]])"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.diag(S)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 1.,  2.],\n",
       "       [ 1.,  3.],\n",
       "       [ 1.,  4.]])"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.dot(U.dot(np.diag(S)), V)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "`TruncatedSVD`返回的矩阵是$U$和$S$的点积。如果我们想模拟TSVD，我们就去掉最新奇异值和对于$U$的列向量。例如，我们想要一个主成份，可以这样："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([-2.20719466, -3.16170819, -4.11622173])"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "new_S = S[0]\n",
    "new_U = U[:, 0]\n",
    "new_U.dot(new_S)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "一般情况下，如果我们想要截断维度$t$，那么我们就去掉$N-t$个奇异值。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "##There's more..."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "`TruncatedSVD`还有一些细节需要注意。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "###符号翻转（Sign flipping）"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "`TruncatedSVD`有个“陷阱”。随着随机数生成器状态的变化，`TruncatedSVD`连续地拟合会改变输出的符合。为了避免这个问题，建议只用`TruncatedSVD`拟合一次，然后用其他变换。这正是管线命令的另一个用处。\n",
    "\n",
    "要避免这种情况，可以这样："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 5.91220352, -2.30344211],\n",
       "       [ 5.57207573, -1.97383104],\n",
       "       [ 5.4464847 , -2.09653267],\n",
       "       [ 5.43601924, -1.87168085],\n",
       "       [ 5.87506555, -2.32934799]])"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tsvd = TruncatedSVD(2)\n",
    "tsvd.fit(iris_data)\n",
    "tsvd.transform(iris_data)[:5]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "###稀疏矩阵"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "`TruncatedSVD`相比PDA的一个优势是`TruncatedSVD`可以操作PDA处理不了的矩阵。这是因为PCA必须计算协方差矩阵，需要在整个矩阵上操作，如果矩阵太大，计算资源可能会不够用。"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
